<%@page import="databank.DataBankVo"%>
<%@page import="java.util.Vector"%>
<%@page import="databank.DataBank"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>list.jsp</title>
<style>
	@import url(http://fonts.googleapis.com/earlyaccess/nanumgothic.css);
</style>
<style>
#list_button{
	width:100%;
	margin: 0 auto;
	text-align: center;
	padding-top:30px;
	font-family: 'Nanum Gothic', sans-serif;

}
#databank_insert{
width: 100%;
}
#databank_list_find{
width: 100%;
text-align: right;
}
#list_title, #list_serial, #list_mid, #list_subject, #list_content, #list_mdate{
background-color: #A6A6A6;
display: inline-block;

}
#list_body, #list_serial1, #list_mid1, #list_subject1, #list_content1, #list_mdate1{

 display: inline-block;

}
#list_title{
 width: 95%;
 border-top:   1px solid black;
border-left:   1px solid black;
border-right:  1px solid black;
}
#list_serial{
 width: 7%;
}
#list_mid{
 width: 15%;
}
#list_subject{
 width: 25%;
 }
#list_content{
 width: 25%;
}
#list_mdate{
 width: 20%;
}

#list_body{
 width: 95%;
 border-bottom: 1px solid black;
 border-left:   1px solid black;
 border-right:  1px solid black;
}
#list_serial1{
 width: 7%;
}
#list_mid1{
 width: 15%;
}
#list_subject1{
 width: 25%;
 }
#list_content1{
 width: 25%;
}
#list_mdate1{
 width: 20%;
}
</style>
<script>
function go_up(){
	location.href="index2.jsp?inc_center=./databank/upload_form.jsp";
}
function view(a){
	location.href="index2.jsp?inc_center=./databank/view.jsp&serial="+a;
}
</script>
</head>
<body>
<jsp:useBean id="bankVo" class="databank.DataBankVo"/>
<jsp:setProperty property="*" name="bankVo"/>
<%
DataBank bank = new DataBank();
bank.setVo(bankVo);
Vector<DataBankVo> v = bank.list();

%>

<div id="list_button">
	<div id="databank_insert">
	<input type="button" value="글쓰기" onclick="go_up()" 
	style="width: 100%; height: 50px; border:2px dotted #B2CCFF; border-radius:20px; 
	font-family: 'Nanum Gothic', sans-serif; font-size: 20px; font-weight: bolder; color: #4374D9;">
	</div>
	
	<br/><br/>
	<div id="databank_list_find">
		<form name="upload_frm" method="post" action="">
			<input type="text" name="find" id="find">
			<input type="submit" value="검색" id="btnFind">
		</form>
	</div>
	
	<br/><br/>
	<div id="list_title">
		<div id="list_serial">넘버
		</div>
		<div id="list_mid">아이디
		</div>
		<div id="list_subject">제목
		</div>
		<div id="list_content">내용
		</div>
		<div id="list_mdate">날짜
		</div>
	</div>
<%
for(int i=0; i<v.size(); i++){
	DataBankVo dv = v.get(i);
%>
	<div id="list_body">
		<div id="list_serial1"><%=dv.getSerial()%>
		</div>
		<div id="list_mid1"><%=dv.getMid()%>
		</div>
		<div id="list_subject1"><a href="#" onclick='view(<%=dv.getSerial()%>)'><%=dv.getSubject()%></a>
		</div>
		<div id="list_content1"><%=dv.getContent()%>
		</div>
		<div id="list_mdate1"><%=dv.getMdate()%>
		</div>
	</div>
<%} %>
	
</div>

</body>
</html>